package sg.edu.nus.dashboard.main.control.command
{
	
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.rpc.IResponder;
	
	import sg.edu.nus.dashboard.main.control.business.GetConnectDelegate;
	import sg.edu.nus.dashboard.main.control.event.GetConnectEvent;
	import sg.edu.nus.dashboard.main.model.AppModelLocator;
	
	public class GetConnectCommand implements ICommand, IResponder
	{
		private var model:AppModelLocator = AppModelLocator.getInstance();
		
		public function execute(event:CairngormEvent):void
		{
			var d:GetConnectDelegate = new GetConnectDelegate(this);
			var e:GetConnectEvent = GetConnectEvent(event);
			
			d.getConnectionInfo();
		}
		
		public function result(data:Object):void
		{
			model.connectInfoStr = data.result;
		}
		
		public function fault(info:Object):void
		{
		}
	}
}